package com.mark.mall.web.platform.controller;


import com.github.pagehelper.PageInfo;
import com.mark.mall.common.resultBean.R;
import com.mark.mall.web.platform.dto.PageParamDTO;
import com.mark.mall.web.platform.dto.ProductDTO;
import com.mark.mall.web.platform.service.ProductService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 供应商 前端控制器
 * </p>
 *
 * @author admin
 * @since 2021-03-03
 */
@RestController
@RequestMapping("/web/provider")
@Api(tags = "前台供应商模块")
@RequiredArgsConstructor
public class ProviderController {
    private final ProductService productService;

    @ApiOperation(value = "首页获取物料列表,查询名称或者code", httpMethod = "GET")
    @GetMapping("list")
    public R<PageInfo<ProductDTO>> listProductPageInfo(PageParamDTO param, String searchName) {
        return productService.listProductPageInfo(param, searchName);
    }
}
